package edu.tjut.tjutcommunity.httpInterface;

import com.dtflys.forest.annotation.*;
import com.dtflys.forest.http.ForestResponse;
import edu.tjut.tjutcommunity.entity.LoginBody;

public interface LoginHttp {


    @GetRequest("http://authserver.tjut.edu.cn/authserver/login?service=http%3A%2F%2Fehall.tjut.edu.cn%2Flogin%3Fservice%3Dhttp%3A%2F%2Fehall.tjut.edu.cn%2Fnew%2Findex.html")
    ForestResponse<String> index();

    @GetRequest(
            url = "http://ehall.tjut.edu.cn/jsonp/userDesktopInfo.json",
            headers = {
                    "Cookie: ${cookie}"
            }
    )
    ForestResponse<String> getUserInfo(@Var("cookie") String cookie);
    //无效
    @Redirection(false)
    @Post(
            url = "${URL}",
            headers = {
                    "Cookie: ${cookie}"
            },
            contentType = "application/x-www-form-urlencoded"
    )
    ForestResponse<String> loginRedirect(@Var("URL") String url, @Var("cookie") String cookie, @Body LoginBody userInfo);

    @Post(
            url = "${URL}",
            headers = {
                    "Cookie: ${cookie}"
            }
    )
    ForestResponse<String> loginCheck(@Var("URL") String url, @Var("cookie") String cookie);
    @Get(
            url = "http://ssfw.tjut.edu.cn/ssfw/xkgl/xkjgcx.do",
            headers = {
                    "Cookie: ${cookie}"
            }
    )
    ForestResponse<String> getxkjg(@Var("cookie") String cookie);


}
